//import java.util.Scanner;
//interface Soundable {
//    public void increaseVolume( );
//    public void decreaseVolume( );
//    public void stopSound( );
//    public void playSound( );
//}
//class Radio implements Soundable {
//    public void increaseVolume( ) {
//        System.out.println("增大收音机音量");
//    }
//    public void decreaseVolume( ) {
//        System.out.println("减小收音机音量");
//    }
//    public void stopSound( ) {
//        System.out.println("关闭收音机");
//    }
//    public void playSound( ) {
//        System.out.println("收音机播放广播");
//    }
//}
//class Walkman implements Soundable {
//    public void increaseVolume( ) {
//        System.out.println("增大随声听音量");
//    }
//    public void decreaseVolume( ) {
//         // 输出减小随声听音量
//    }
//    public void stopSound( ) {
//        System.out.println("关闭随声听");
//    }
//    public void playSound( ) {
//        System.out.println("随声听发出音乐");
//    }
//}
//class Mobilephone implements Soundable {
//    public void increaseVolume( ) {
//        System.out.println("增大手机音量");
//    }
//    public void decreaseVolume( ) {
//        System.out.println("减小手机音量");
//    }
//    public void stopSound( ) {
//        System.out.println("关闭手机");
//    }
//    public void playSound( ) {
//        System.out.println("手机发出来电铃声");
//    }
//
//}
//class Clock implements Soundable{
//    public void stopSound(){
//        System.out.println("关闭闹钟 ");
//    }
//    public void playSound(){
//        System.out.println("闹钟发出滴答声 ");
//    }
//    public void increaseVolume(){}
//    public void decreaseVolume(){}
//}
//
//class People {
//    private String name;
//    private int    age;
//    public void listen(Soundable s) {
//        s.playSound( );
//    }
//}
//public class InterfaceTest {
//    public static void main(String[] args) {
//        int i;
//        People sportsman = new People( );
//        Scanner scanner = new Scanner(System.in);
//        Soundable[] soundDevice = new Soundable[4];
//        //往声音设备数组中放入能发声的设备
//        soundDevice[0] = new Radio( );
//        soundDevice[1] = new Walkman( );
//        soundDevice[2] = new Mobilephone( );
//        soundDevice[3] = new Clock( );
//         //创建手机对象并赋值给soundDevice[2]
//        System.out.println("你想听什么? 请输入选择：0-收音机 1-随声听 2-手机 3-闹钟");
//        i = scanner.nextInt( );
//        //开始听声音
//        sportsman.listen(soundDevice[i]);
//        soundDevice[i].increaseVolume( );
//         //调用stopSound( )方法
//    }
//}
import java.util.*;
interface moveable{
    public void startsMove();
    public void stopsMove();
    public void increaseSpeed();
    public void decreaseSpeed();
}
class Car implements moveable{
    public void startsMove(){
        System.out.println("汽车开始移动");
    }
    public void stopsMove(){
        System.out.println("汽车停止");
    }
    public void increaseSpeed(){
        System.out.println("汽车加速");
    }
    public void decreaseSpeed(){
        System.out.println("汽车减速");
    }
}
class Ship implements moveable{
    public void startsMove(){
        System.out.println("船开始移动");
    }
    public void stopsMove(){
        System.out.println("船停止");
    }
    public void increaseSpeed(){
        System.out.println("船加速");
    }
    public void decreaseSpeed(){
        System.out.println("船减速");
    }
}
class Plan implements moveable{
    public void startsMove(){
        System.out.println("飞机开始移动");
    }
    public void stopsMove(){
        System.out.println("飞机停止");
    }
    public void increaseSpeed(){
        System.out.println("飞机加速");
    }
    public void decreaseSpeed(){
        System.out.println("飞机减速");
    }
}
public class InterfaceTest {
    public static void main(String[] args) {
        Scanner input=new Scanner(System.in);
        moveable[] move=new moveable[3];
        move[0]=new Car();
        move[1]=new Ship();
        move[2]=new Plan();
        while (true){
            System.out.println("你想乘坐什么? 请输入选择: 0-汽车 1-船 2飞机");
            int i=input.nextInt();
            move[i].startsMove();
            move[i].increaseSpeed();
            move[i].decreaseSpeed();
            move[i].stopsMove();
        }
    }
}